#include "qdialog4.h"
#include"fraction.h"
#include<string>

extern int cal_form;
int _row1;
double _times_1;
int _times_1f_nume, _times_1f_demo=1;

qdialog4::qdialog4(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);
	connect(this, &qdialog4::accepted, [=]() {
		_row1 = ui.row_4->text().toInt()-1;
        if (cal_form == 0) {
            _times_1 = ui.times_1->text().toDouble();
        }
        else if (cal_form == 1) {
            QString str = ui.times_1->text();
            std::string s = str.toStdString();
            
            if (s.find("/") != -1) {
                _times_1f_nume = str.left(str.indexOf("/")).toInt();
                _times_1f_demo = str.mid(str.indexOf("/") + 1).toInt();
            }
            else {
                _times_1f_nume = str.toInt();
            }
        }
		});
}

qdialog4::~qdialog4()
{
}